package com.whg.demo.controller;

import com.whg.demo.model.JsonData;
import com.whg.demo.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @Author whg
 * @create 2022/12/1 14:43
 * @description：
 */
@RestController
@RequestMapping("/api2")
public class Api2Controller {

    @GetMapping("/v1/test")
    public JsonData test(){
        System.out.println("Api2Controller======>v1/test");
        User user = new User("whg","15797897837",new Date(),24,"88888");
        return JsonData.buildSuccess(user);
    }

    @GetMapping("/v2/test2")
    public JsonData test2(){
        System.out.println("Api2Controller======>v2/test2");
        User user = new User("whg","15797897837",new Date(),24,"88888");
        return JsonData.buildSuccess(user);
    }
}
